
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <string.h>

union semun{
	int val;
}su;

int main()
{
	int id=semget(1234,0,0);
	if(id==-1)	perror("semget"),exit(1);

	printf("%d\n",semctl(id,0,GETVAL));
}

